package com.hu.video.controller;

import com.hu.video.service.IAdminEChartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;


@Controller // 声明该类为控制器类
@RequestMapping("admin") // 声明控制器的根路径为/admin
public class AdminEChartController {

    @Autowired // 自动装配IAdminEChartService实例
    private IAdminEChartService adminEChartService;

    // 处理/admin/getFilmData请求，并将返回值转换为JSON格式
    @RequestMapping("getFilmData")
    @ResponseBody
    public List<String> getFilmData() {
        return adminEChartService.getFilmData();
    }

    // 处理/admin/getData请求，并将返回值转换为JSON格式
    @RequestMapping("getData")
    @ResponseBody
    public List<Integer> getData() {
        return adminEChartService.getData();
    }
}
